#!/bin/sh

OUTPUT_DIR="output"
DEB_OUTPUT_DIR=$OUTPUT_DIR/deb
TARBALL_OUTPUT_DIR=$OUTPUT_DIR/tarball
CODEDOC_OUTPUT_DIR=$OUTPUT_DIR/codedoc
DOC_OUTPUT_DIR=$OUTPUT_DIR/documentation

rm -rf $OUTPUT_DIR
mkdir -p $DEB_OUTPUT_DIR $TARBALL_OUTPUT_DIR $CODEDOC_OUTPUT_DIR $DOC_OUTPUT_DIR

#cd documentation
#sh generate-pdf.sh
#cp output/unimail-doc-*.pdf ../$DOC_OUTPUT_DIR
#cd ..

PACKAGE=unimail
cd $PACKAGE/scripts
sh generate-deb.sh
sh generate-codedoc.sh
cp output/$PACKAGE_*.deb ../../$DEB_OUTPUT_DIR
cp output/$PACKAGE-*.tar.gz ../../$TARBALL_OUTPUT_DIR
cp -r output/$PACKAGE-*-codedoc ../../$CODEDOC_OUTPUT_DIR
cd ../..

echo "All packages generated successfully into 'output' folder."
